#ifndef __M26_DEV_H__
#define __M26_DEV_H__	 

#include "nstar_m26_api.h"

#define M26_MAX_RLEN 1024
#define M26_MAX_SLEN 100
#define M26_COMM_ACKTCNT 5	/*普通at命令响应时间-500ms*/


typedef  struct m26_device_
{
	unsigned char  step;			//状态机
	unsigned char  init_sta;		//0:初始化，1：初始化成功，2：初始化失败
	unsigned char  last_err;		//记录上一次err的step
	unsigned char  ring_cnt;		//电话响铃声的计数
	unsigned char  sq;				//信号质量
	unsigned char  ata_phonenb[12];	//呼叫者电话号码
	unsigned char  *rbuf;			//数据缓存
	void (*pwrctl)(void);								//开机，重启模块
	void (*printf)(char* fmt,...);						//串口发送
	void (*send)(const unsigned char *data,unsigned int len);//串口发送指定长度数据
	unsigned char (*cmd)(char *cmd,char *ack);				//普通命令
	unsigned char (*cmd1)(char *cmd,char *ack,unsigned short tcnt);				//普通命令
	unsigned char (*cmd2)(char *cmd,char *ack1,char *ack2, unsigned short tcnt);//有2种回复结果的命令
	char* (*get_data)(char *cmd,char *ack,unsigned short tcnt);	//获取状态数据
	volatile long *private;	//私有数据(计时器)
	
}M26_DEV;

extern M26_DEV M26_DEV1;


void M26_dev_init(M26_DEV* p_dev);


#endif


